<template>
<div class="circuit-publish-form">
	<a-form :form="form" @submit="handleSubmit">
		<div class="publish-road-info">
			<!-- 公共出发地、到达地 -->
			<a-row class="inp-w280" >
			 	<a-col :span="12">
			 	 	<a-form-item label="出发地" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
				    	<a-input :disabled="disabled" readOnly @click="departureShowMap" v-decorator="['fromCity',{rules: [{ required: true,message: '请选择车辆出发地！'},]}]" placeholder="请选择车辆出发地"/>
				  	</a-form-item>
			 	</a-col>
			 	<a-col :span="12">
			 	 	<a-form-item label="到达地" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
				 	 	<a-input :disabled="disabled" readOnly @click="destinationShowMap" v-decorator="['toCity',{rules: [{ required: true ,message: '请选择车辆到达地！'}]}]" placeholder="请选择车辆到达地"/>
				 	</a-form-item>
			 	</a-col>
			</a-row>
			<a-row class="inp-w280" v-if="lineType == 3">
			 	<a-col :span="20">
			 		
					<a-form-item :label-col="{ span: 3 }" :wrapper-col="{ span: 21 }" label="出发机场">
					    <a-select disabled placeholder='请选择' style="width:160px;margin-right: 10px;" @change="getFromCity"  v-decorator="[ 'airFromProvince',{rules: [{ required: true,message: '请选择出发地！'},]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     		  	<a-select-option :value="item" v-for="(item,index) in provinceList"  :key="index">{{item}}</a-select-option>
					    </a-select>
					    <a-select :disabled="disabled" placeholder='请选择' style="width:160px;;margin-right: 10px;" @change="getFromAirport" v-decorator="[ 'airFromCity',{rules: [{ required: true,message: '请选择出发地！'},]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     			<a-select-option :value="item" v-for="(item,index) in fromCityList"  :key="index">{{item}}</a-select-option>
					    </a-select>
					    <a-select :disabled="disabled" placeholder='请选择' style="width:180px;" v-decorator="[ 'fromAirPortTcode', {rules: [{ required: true, message: '请选择机场名称！' }]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     			<a-select-option :value="item.tcode" v-for="(item,index) in airFromAirportList"  :key="index">{{item.airPortName}}</a-select-option>
					    </a-select>
					</a-form-item>
			 	</a-col>
			 	<!--<a-col :span="12">
					<a-form-item :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" label="机场名称">
					    <a-select :disabled="disabled" placeholder='请选择' v-decorator="[ 'fromAirPortTcode', {rules: [{ required: true, message: '请选择机场名称！' }]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     			<a-select-option :value="item.tcode" v-for="(item,index) in airFromAirportList"  :key="index">{{item.airPortName}}</a-select-option>
					    </a-select>
					</a-form-item>
			 	</a-col>-->
			</a-row>
			<a-row class="inp-w280" v-if="lineType == 3">
			 	<a-col :span="20">
					<a-form-item :label-col="{ span: 3 }" :wrapper-col="{ span: 19 }" label="到达机场">
					    <a-select disabled placeholder='请选择' style="width:160px;margin-right: 10px;" @change="getToCity"  v-decorator="[ 'airToProvince',{rules: [{ required: true,message: '请选择出发地！'},]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     			<a-select-option :value="item" v-for="(item,index) in provinceList"  :key="index">{{item}}</a-select-option>
					    </a-select>
					    <a-select :disabled="disabled" placeholder='请选择' style="width:160px;;margin-right: 10px;" @change="getToAirport" v-decorator="[ 'airToCity',{rules: [{ required: true,message: '请选择车辆出发地！'},]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     			<a-select-option :value="item" v-for="(item,index) in toCityList"  :key="index">{{item}}</a-select-option>
					    </a-select>
					     <a-select :disabled="disabled" placeholder='请选择' style="width:180px;" v-decorator="[ 'toAirPortTcode', {rules: [{ required: true, message: '请选择机场名称！' }]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     			<a-select-option :value="item.tcode" v-for="(item,index) in airToAirportList"  :key="index">{{item.airPortName}}</a-select-option>
					    </a-select>
					</a-form-item>
			 	</a-col>
			 	<!--<a-col :span="12">
					<a-form-item :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" label="机场名称">
					    <a-select :disabled="disabled" placeholder='请选择'  v-decorator="[ 'toAirPortTcode', {rules: [{ required: true, message: '请选择机场名称！' }]}]" class="w-140">
					    	<a-select-option value="">请选择</a-select-option>
			     			<a-select-option :value="item.tcode" v-for="(item,index) in airToAirportList"  :key="index">{{item.airPortName}}</a-select-option>
					    </a-select>
					</a-form-item>
			 	</a-col>-->
			</a-row>

			<!-- 公路运输 -->
			<div v-if="lineType == 1" class="road-transport-part">
				<div class="road-change-box">
					<a-row class="inp-w280">
				  	 	<a-col :span="12">
				  	 	 	<a-form-item label="运输类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
							    <a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'transType' , {rules: [{ required: lineType == 1, message: '请选择运输类型！' }]}]"  @change="railChange">
								    <a-select-option v-for="(item,index) in highwayList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
								</a-select>
						  	</a-form-item>
				  	 	</a-col>
				  	 	<a-col :span="12">
				  	 	 	    <a-form-item label="车辆类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
						        <a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'carType' , {rules: [{ required: lineType == 1, message: '请选择车辆类型！' }]}]"  >
								    <a-select-option v-for="(item,index) in carTypeList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
							    </a-select>
						     </a-form-item>
				  	 	</a-col>	 
					</a-row>
				</div>
				<a-row class="inp-w280" v-if="railbkey == 31 || railbkey == 33">
				 	<a-col :span="12">
				 	 	<a-form-item label="运价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
				     		<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['transPrice',{rules: [{ required: lineType == 1, message: '请输入运价！' }]}]" placeholder="运价"/><i class="wei_yunjia">元起/车</i>
					  	</a-form-item>
				 	</a-col>
				</a-row>
				<a-row class="inp-w280"  v-if="railbkey == 32">
			 		<a-col :span="12">
				 	 	<a-form-item label="重货价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
					       <a-input-number style="width: 60%;" size="large" :min="0.01" :precision='2'  :disabled="disabled" class="wei_weight" v-decorator="['weightPrice',{rules: [{ required: lineType == 1, message: '请输入重货价！' }]}]" placeholder="重货价"/>
					       <a-select :disabled="disabled" class="wei_select" placeholder="请选择"  v-decorator="['weightPriceUnit',{initialValue: ''}]">
					       	 	<a-select-option   value="">请选择</a-select-option>
							    <a-select-option v-for='(item,index) in weightList'  :key="index"   :value="item.dictKey">{{item.dictValue}}</a-select-option>
						   </a-select>
				  		</a-form-item>
				 	</a-col>
				 	<a-col :span="12">
				 	 	<a-form-item label="轻货价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
					    	<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['volumePrice',{rules: [{ required: lineType == 1, message: '请输入轻货价！' }]}]" placeholder="轻货价"/>
					        <i class="wei_low">元/立方米</i>
				    	</a-form-item>
				 	</a-col>

				</a-row>
			</div>
			<a-row class="inp-w280"  v-if="lineType == 1&&railbkey == 32">
					<a-col :span="12">
				 	 	<a-form-item label="最低一票价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
			          		<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['transPrice']" placeholder="最低票价"/><i class="wei_yuan">元</i>
				      	</a-form-item>
				 	</a-col>
			</a-row>
			<!-- 铁路运输 -->
			<div  v-if="lineType == 2" class="railway-transport-part">
			 	<a-row class="inp-w280">
			 	    <a-col :span="12">
			 	    	<a-form-item label="运输类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
			 	    		<a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'transType' , {rules: [{ required: lineType == 2, message: '请选择运输类型！' }]}]"  @change="railwayChange">
							    <a-select-option v-for="(item,index) in railwayList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
						    </a-select>
				        </a-form-item>
			 	    </a-col>
			 	    <!-- <a-col :span="12">
			 	    	<a-form-item label="车皮类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
					        <a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'carType' , {rules: [{ required: lineType == 2, message: '请选择车皮类型！' }]}]"  >
							    <a-select-option v-for="(item,index) in wagonList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
						    </a-select>
				        </a-form-item>
			 	    </a-col> -->
			 	</a-row>
			 	<!-- <a-row v-if="railwaykey == 34 || railwaykey==36">
			 	    <a-col :span="12" class="inp-w280">
			 	 	    <a-form-item label="运价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
				   	        <a-input-number :min="0"  :disabled="disabled" v-decorator="['transPrice',{rules: [{ required: lineType == 2, message: '请输入运价！' }]}]" placeholder="运价"/>
				            <i class="wei_yunjia">元起/车</i>
				        </a-form-item>
			 	    </a-col>
				</a-row> -->
				<a-row class="inp-w280">
			 		<a-col :span="12">
				 	 	<a-form-item label="重货价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
			       		    <a-input-number style="width: 60%;" size="large" :min="0.01" :precision='2' :disabled="disabled" class="wei_weight" v-decorator="['weightPrice',{rules: [{ required: lineType == 2, message: '请输入重货价！' }]}]" placeholder="重货价"/>
					      	<a-select :disabled="disabled" class="wei_select" placeholder="请选择"  v-decorator="['weightPriceUnit',{initialValue: ''}]">
							    <a-select-option   value="">请选择</a-select-option>
							    <a-select-option v-for='(item,index) in weightList'  :key="index"   :value="item.dictKey">{{item.dictValue}}</a-select-option>
						    </a-select>
				  		</a-form-item>
				 	</a-col>
				 	<a-col :span="12">
				 	 	<a-form-item label="轻货价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
				     		<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['volumePrice',{rules: [{ required: lineType == 2, message: '请输入轻货价！' }]}]" placeholder="轻货价"/>
				       		<i class="wei_low">元/立方米</i>
				      	</a-form-item>
				 	</a-col>
				</a-row>
				<a-row class="inp-w280">
					<a-col :span="12">
				 	 	<a-form-item label="最低一票价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
					        <a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['transPrice']" placeholder="最低票价"/>
					        <i class="wei_yuan">元</i>
				      	</a-form-item>
				 	</a-col>
				</a-row>
			</div>
			<!-- 航空运输 -->
			<div  v-if="lineType == 3" class="air-transport-part">
			 	<a-row class="inp-w280">

					<a-col :span="8">
						<a-form-item label="航空公司" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"  >
						    <a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'airCompany' , {rules: [{ required: lineType == 3, message: '请选择航空公司！' }]}]"  >
							    <a-select-option v-for="(item,index) in airlineList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
							</a-select>
					  	</a-form-item>
				 	</a-col>
			 		<a-col :span="8">
				 	 	<a-form-item label="机型" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"  >
						    <a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'airModel' , {rules: [{ required: lineType == 3, message: '请选择机型！' }]}]">
							    <a-select-option v-for="(item,index) in aircraftTypeList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
							</a-select>
				  		</a-form-item>
				 	</a-col>
			 		<a-col :span="8">
				 	 	<a-form-item label="航班号" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"  >
						    <a-input maxlength="12" onkeyup="this.value=this.value.replace(/[\u4e00-\u9fa5]/ig,'')" :disabled="disabled" v-decorator="['airNo',{rules: [{ required: lineType == 3, message: '请输入航班号' }]}]" placeholder="请输入航班号"/>
				  		</a-form-item>
				 	</a-col>
			 	</a-row>

			 	<a-row class="inp-w280">
					<a-col :span="12">
						<a-form-item label="出发时间" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
						   <a-date-picker  show-time :disabled="disabled"  format="YYYY-MM-DD HH:mm:ss" style="width: 280px;"  v-decorator="[ 'fromTime', {rules: [{ required: lineType == 3, message: '出发时间不能为空!' }]}]" placeholder='请选择出发时间' />
					  	</a-form-item>
				 	</a-col>
			 		<a-col :span="12">
				 	 	<a-form-item label="到达时间" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
						     <a-date-picker  show-time :disabled="disabled"  format="YYYY-MM-DD HH:mm:ss" style="width: 280px;"  v-decorator="[ 'toTime', {rules: [{ required: lineType == 3, message: '到达时间不能为空!' }]}]" placeholder='请选择到达时间' />
				  		</a-form-item>
				 	</a-col>
			 	</a-row>
			 	<a-row class="inp-w280">
					<a-col :span="12">
						<a-form-item label="仓位总数" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
						   <a-input-number style="width: 280px;" size="large" :min="1"  :disabled="disabled"  v-decorator="['airSpaceTotal',{rules: [{ required: lineType == 3, message: '请输入仓位总数' }]}]" placeholder="请输入仓位总数"/>
					  	</a-form-item>
				 	</a-col>
			 		<a-col :span="12">
				 	 	<a-form-item label="剩余仓位" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
						    <a-input-number style="width: 280px;" size="large" :min="1"  :disabled="disabled"  v-decorator="['airSpaceSurplus',{rules: [{ required: lineType == 3, message: '请输入剩余仓位' }]}]" placeholder="请输入剩余仓位"/>
				  		</a-form-item>
				 	</a-col>
			 	</a-row>

			 	<!-- 机型 air_model
				航班号 air_no
				出发时间 from_time
				到达时间 to_time
				仓位总数 air_space_total
				仓位剩余数 air_space_surplus
				线路描述 description -->
			 	
			 	<a-row class="inp-w280">
			 		<a-col :span="12">
				 	 	<a-form-item label="运价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
				 	 		<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['transPrice',{rules: [{ required: lineType == 3, message: '请输入运价！' }]}]" placeholder="运价"/><i class="wei_yunjia">元/起</i>
				 	 		<!-- 
						    <ul class="air-title">
						     	<li>MIN</li>
						     	<li>+45</li>
						     	<li>+100</li>
						     	<li>+300</li>
						     	<li>+500</li>
						     	<li>+1000</li>
						    </ul>
						    <ul class="air-conntent fl">
						     	<li><a-input :disabled="disabled" type="number" v-decorator="[ 'airSeaPrice_1']" placeholder="" /></li>
								<li><a-input :disabled="disabled" type="number" v-decorator="[ 'airSeaPrice_2']" placeholder="" /></li>
								<li><a-input :disabled="disabled" type="number" v-decorator="[ 'airSeaPrice_3']" placeholder="" /></li>
								<li><a-input :disabled="disabled" type="number" v-decorator="[ 'airSeaPrice_4']" placeholder="" /></li>
								<li><a-input :disabled="disabled" type="number" v-decorator="[ 'airSeaPrice_5']" placeholder="" /></li>
								<li><a-input :disabled="disabled" type="number" v-decorator="[ 'airSeaPrice_6']" placeholder="" /></li>
						    </ul> -->
				  		</a-form-item>
				 	</a-col>
			 	</a-row>
			</div>
			<!-- 海路运输- -->
			<div  v-if="lineType == 4" class="sea-transport-part">
				<a-row class="inp-w280">
					<a-col :span="12">
					 	<a-form-item label="运输类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
					 		<a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'transType' , {rules: [{ required: lineType == 4, message: '请选择运输类型！' }]}]"  @change="seawayChange">
							    <a-select-option v-for="(item,index) in seawayList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
							</a-select>
						</a-form-item>
					</a-col>
					<a-col :span="12">
					 	<a-form-item label="抵达时间" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
							<a-input-number style="width: 200px;" size="large" :min="1" :max="365"  :disabled="disabled" placeholder="请输入" v-decorator="[ 'transDay' , {rules: [{ required: lineType == 4, message: '请输入抵达时间！' }]}]" />
							<i class="wei_yuan">天</i>
						</a-form-item>
					</a-col>
				</a-row>
				<a-row class="inp-w280">
					<a-col :span="24" v-if="seakey == 39">
					 	<a-form-item style="width: 65%;margin-left: -25px;" label="接载货物类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
							<a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'loadCargoType' , {rules: [{ required: lineType == 4, message: '请选择接载货物类型！' }]}]">
								<a-select-option v-for="(item,index) in loadCargoTypeList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>
							    <!-- <a-select-option value="1">大件散货</a-select-option>
							    <a-select-option value="2">件杂</a-select-option>
							    <a-select-option value="3">滚装</a-select-option> -->
							</a-select>
						</a-form-item>
					</a-col>
				</a-row>

				<!-- 海运整箱 -->
				<div class="seaway-tcl" v-if="seakey == 37">
					<a-row>
						<a-form-item label="离港班期" :label-col="{ span: 2 }" :wrapper-col="{ span: 18 }">
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_1',{ valuePropName: 'checked',initialValue: false }]">周一</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_2',{ valuePropName: 'checked',initialValue: false }]">周二</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_3',{ valuePropName: 'checked',initialValue: false }]">周三</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_4',{ valuePropName: 'checked',initialValue: false }]">周四</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_5',{ valuePropName: 'checked',initialValue: false }]">周五</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_6',{ valuePropName: 'checked',initialValue: false }]">周六</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_7',{ valuePropName: 'checked',initialValue: false }]">周日</a-checkbox>
								</a-col>
						</a-form-item>
					</a-row>
					<a-row class="road-before air-place" style="width: 85%;">
						<a-col>
						 	<a-form-item label="运价(美元)" :label-col="{ span: 3 }" :wrapper-col="{ span: 20 }"  >
								<ul class="air-title">
								 	<li>20’</li>
								 	<li>40’</li>
								 	<li>40HQ</li>
								 	<li>45’</li>
								</ul>
								<ul class="air-conntent">
							     	<li><a-input :disabled="disabled" type="number" min="0"  v-decorator="[ 'airSeaPrice_1', {rules: [{ required: true, message: '请输入运价！' }]}]" placeholder="" /></li>
									<li><a-input :disabled="disabled" type="number" min="0"  v-decorator="[ 'airSeaPrice_2']" placeholder="" /></li>
									<li><a-input :disabled="disabled" type="number" min="0"  v-decorator="[ 'airSeaPrice_3']" placeholder="" /></li>
									<li><a-input :disabled="disabled" type="number" min="0"  v-decorator="[ 'airSeaPrice_4']" placeholder="" /></li>
								</ul>
							</a-form-item>
						</a-col>
					</a-row>
				</div>
				<!-- 海运拼箱 -->
				<div class="seawy-shipingLcl" v-if="seakey == 38">
					<a-row>
						<a-form-item label="离港班期" :label-col="{ span: 2 }" :wrapper-col="{ span: 18 }">
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_1',{ valuePropName: 'checked',initialValue: false }]">周一</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_2',{ valuePropName: 'checked',initialValue: false }]">周二</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_3',{ valuePropName: 'checked',initialValue: false }]">周三</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_4',{ valuePropName: 'checked',initialValue: false }]">周四</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_5',{ valuePropName: 'checked',initialValue: false }]">周五</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_6',{ valuePropName: 'checked',initialValue: false }]">周六</a-checkbox>
								</a-col>
								<a-col :span="3">
									<a-checkbox :disabled="disabled" v-decorator="['week_7',{ valuePropName: 'checked',initialValue: false }]">周日</a-checkbox>
								</a-col>
						</a-form-item>
					</a-row>
					<a-row class="inp-w280">
						<a-col :span="12">
						 	<a-form-item label="运价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
								<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['transPrice',{rules: [{ required: lineType == 4, message: '请输入运价！' }]}]" placeholder="运价"/>
							  	<i class="wei_yunjia">美元/吨</i>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item label="" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
									<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" placeholder=""/>
									<i class="wei_yunjia_l">美元/立方米</i>
							</a-form-item>
						</a-col>
					</a-row>
				</div>
				<!-- 海运散杂 -->
				<div class="seawy-freight" v-if="seakey == 39">
					<!-- <a-row class="inp-w280">
						<a-col :span="12">  
						 	<a-form-item label="船舶类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
								<a-select :disabled="disabled" placeholder="请选择" v-decorator="[ 'shipType' , {rules: [{ required: lineType == 4, message: '请选择船舶类型！' }]}]">
								    <a-select-option v-for="(item,index) in shipTypeList" :key="index" :value="item.dictKey">{{item.dictValue}}</a-select-option>

								</a-select>
							</a-form-item>
						</a-col>
						<a-col :span="12">
						 	<a-form-item label="运价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
								<a-input :disabled="disabled" v-decorator="['transPrice',{rules: [{ required: lineType == 4, message: '请输入运价！' }]}]"  maxLength="16" placeholder="运价"/>
							  	<i class="wei_yunjia">美元/吨</i>
							</a-form-item>
						</a-col>
					</a-row> -->

					<a-row class="inp-w280">
						<a-col :span="12">
						 	<a-form-item label="运价" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"  >
								<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" v-decorator="['transPrice',{rules: [{ required: lineType == 4, message: '请输入运价！' }]}]" placeholder="运价"/>
							  	<i class="wei_yunjia">美元/吨</i>
							</a-form-item>
						</a-col>
						<a-col :span="12">
							<a-form-item label="" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
									<a-input-number style="width: 200px;" size="large" :min="0.01" :precision='2'  :disabled="disabled" placeholder=""/>
									<i class="wei_yunjia_l">美元/立方米</i>
							</a-form-item>
						</a-col>
					</a-row>

				</div>
			</div>
			<!-- 公共有效时间 -->
		 	<a-row class="road-w170 road-300">
			 	<a-col :span="12">
			 	 	<a-form-item label="有效期" :label-col="{ span: 5 }"  :wrapper-col="{ span: 12 }" :value="1" >
			 	 		<div  v-decorator="['validDay',{rules: [{ required: true, message: '请输入有效期！' }]}]">
					      	<a-input-number style="width: 160px;" size="large" :min="1" :max="365" v-model="inputs" @keyup="inpDay" :disabled="validDayDisabled||disabled"  placeholder="请输入有效期"/>
					      	<i>天</i>
					      	<a-checkbox v-model="longValid" :disabled="longValidDisabled||disabled" @change="show">长期有效</a-checkbox>
			 	 		</div>
				    </a-form-item>
			 	</a-col>
			</a-row>
			<!-- 公共线路介绍 -->
		 	<a-row>
			 	<a-col :span="20">
			 	 	<a-form-item label="线路介绍" :label-col="{ span: 3 }"  :wrapper-col="{ span: 15 }" :value="1" >
					    <a-textarea :disabled="disabled" maxLength="180" v-decorator="['description']"  placeholder="请输入线路介绍"/>
				    </a-form-item>
			 	</a-col>
			</a-row>
			<!--<a-row class="road-w170 road-300">
			 	<a-col :span="8">
			 	 	<a-form-item label="有效期" :label-col="{ span: 6 }"  :wrapper-col="{ span: 12 }" :value="1" >
				      	<a-input  type="number" min="0"  :disabled="validDayDisabled||disabled"  v-decorator="['validDay',{rules: [{ required: !validDayDisabled, message: '请输入有效期！' },{validator: this.changeDate}]}]" placeholder="请输入有效期"/>
				      	<i>天</i>
				    </a-form-item>
			 	</a-col>
			 	<a-col :span="12">
			 	 	<a-form-item label="" :label-col="{ span: 0 }" :wrapper-col="{ span: 12 }" :value="2">
				      	<a-checkbox :disabled="longValidDisabled||disabled" @click="show()"  v-decorator="['longValid',{ valuePropName: 'checked',initialValue: false }]">长期有效</a-checkbox>
				    </a-form-item>
			 	</a-col>
			</a-row>-->
		</div>
		<div class="public-road-title">联系方式</div>
		<!-- 出发地 -->
		<div class="start-concat-box">
		  	<div class="start-place">出发地</div>
		  	<div class="start-form">
	  	  	 	<a-row class="star-w150">
		  	  	 	<a-col :span="11">
		  	  	 	 	<a-form-item label="联系人：" :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }" >
		  	  	 	 		<a-input :disabled="disabled" v-decorator="['fromLinkMan',{rules: [{ required: true, message: '请输入联系人！' }]}]" placeholder="请输入联系人"/>
						  	</a-form-item>
		  	  	 	</a-col>
		  	  	 	<a-col :span="13">
		  	  	 	 	<a-form-item label="联系人手机号" :label-col="{ span: 10 }" :wrapper-col="{ span: 12 }" >
					    	<a-input :disabled="disabled" v-decorator="['fromLinkMobile',{rules: [{ required: true, message: '请输入联系人手机号！' },{ validator: checkMobile}]}]" placeholder="请输入联系人手机号"/>
						   	</a-form-item>
		  	  	 	</a-col>
	  	  	  	</a-row>
	  	  		<a-row class="star-w150">
		  	  	 	<a-col :span="11">
		  	  	 	 	<a-form-item label="QQ号" :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }" >
					    	<a-input :disabled="disabled" v-decorator="['fromLinkQq']" placeholder="请输入QQ"/>
						  	</a-form-item>
		  	  	 	</a-col>
		  	  	 	<a-col :span="13">
		  	  	 		<a-form-item label="传真地址" :label-col="{ span: 10 }" :wrapper-col="{ span: 12 }" >
					    	<a-input :disabled="disabled"  v-decorator="['fromLinkFax']" placeholder="请输入传真地址"/>
						  	</a-form-item>
		  	  	 	</a-col>
	  	  		</a-row>
  	  	 		<a-form-item label="详细地址" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }" >
			    	<a-input :disabled="disabled" v-decorator="['fromLinkAddress',{rules: [{ required: true, message: '请输入详细地址！' }]}]" placeholder="请输入详细地址"/>
				</a-form-item>
		  	</div>
		</div>
		<!-- 到达地 -->
		<div class="start-concat-box arrive-concat-box">
		  	<div class="start-place">到达地</div>
		  	<div class="start-form">
	  	  	 	<a-row class="star-w150">
		  	  	 	<a-col :span="11">
		  	  	 	 	<a-form-item label="联系人：" :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }" >
		  	  	 	 		<a-input :disabled="disabled" v-decorator="['toLinkMan',{rules: [{ required: true, message: '请输入联系人！' }]}]" placeholder="请输入联系人"/>
						  	</a-form-item>
		  	  	 	</a-col>
		  	  	 	<a-col :span="13">
		  	  	 	 	<a-form-item label="联系人手机号" :label-col="{ span: 10 }" :wrapper-col="{ span: 12 }" >
					    	<a-input :disabled="disabled" v-decorator="['toLinkMobile',{rules: [{ required: true, message: '请输入联系人！' },{ validator: checkMobile }]}]" placeholder="请输入联系人手机号"/>
						   	</a-form-item>
		  	  	 	</a-col>
	  	  	  	</a-row>
	  	  		<a-row class="star-w150">
		  	  	 	<a-col :span="11">
		  	  	 	 	<a-form-item label="QQ号" :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }" >
					    	<a-input :disabled="disabled" v-decorator="['toLinkQq']" placeholder="请输入QQ"/>
						  	</a-form-item>
		  	  	 	</a-col>
		  	  	 	<a-col :span="13">
		  	  	 		<a-form-item label="传真地址" :label-col="{ span: 10 }" :wrapper-col="{ span: 12 }" >
					    	<a-input :disabled="disabled"  v-decorator="['toLinkFax']" placeholder="请输入传真地址"/>
						  	</a-form-item>
		  	  	 	</a-col>
	  	  		</a-row>
  	  	 		<a-form-item label="详细地址" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }" >
			    	<a-input :disabled="disabled" v-decorator="['toLinkAddress',{rules: [{ required: true, message: '请输入联系人！' }]}]" placeholder="请输入详情地址"/>
				</a-form-item>
			</div>
		</div>
		<a-row class="public-agree"  v-if="type=='add'">
			<a-form-item :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }" label="协议" class="wy-agreement"  >
				<a-checkbox   v-decorator="['agreement',{ rules: [ {required: true, message: '请阅读并接受'}]}]">
					我已阅读并接受<a href="javascript:;" @click="userShow=true">《云南国际物流云用户协议》</a><a href="javascript:;" @click="webShow=true">《用户信息发布协议》</a>
				</a-checkbox>
			</a-form-item>
		</a-row>
		<a-row class='public-btn' v-if="type!='find'">
			<a-button type="primary" html-type="submit">{{type=='add'?'立即发布':'确认修改'}}</a-button>
		</a-row>
	</a-form>
	<!--地图Svg显示位置-->
	<map-svg ref="mapSvgDialog" @change="mapSvgCall" @distance="distanceCall"></map-svg>
		<a-modal  :visible="webShow" @cancel="close" width="900px"  :maskClosable='false' :footer="null">
			<web @close="close" v-show="webShow" @cancel="close"></web>
		</a-modal>
		<a-modal  :visible="userShow" @cancel="close" width="900px"  :maskClosable='false' :footer="null">
			<user @close="close" v-show="userShow" @cancel="close"></user>
		</a-modal>
	
</div>
</template>
<script>
	import MapSvg from '@/components/dialog/MapSvg'
	import {checkTel, checkTelNum, checkEmail} from 'utils/formValidate'
	import Web from '@/components/tool/web'
	import User from '@/components/tool/user'
	import moment from 'moment'
	import 'moment/locale/zh-cn';
	moment.locale('zh-cn')
	export default {
		data() {
			return {
				provinces:'',
				loading:false,
				longValid:false,
				inputs:'',
				disabled:false,
				webShow:false,
				userShow:false,
				clause:false,
				longValidDisabled:false,
				validDayDisabled:false,
			  	seakey: 37,// 海路
			  	railbkey: 31,// 公路
			  	//avakey:0,//航空
			  	railwaykey: 34,// 铁路
			  	// 加个单位列表
			  	weightList:[],
			  	// 车辆类型列表
			  	carTypeList: [],
			  	// 车皮类型列表
			  	// wagonList: [],
			  	// 公路运输类型列表
			  	highwayList: [],
			  	// 海路运输类型列表
			  	railwayList: [],
			  	// 海路运输类型列表
			  	seawayList: [],
			  	// 海路船舶类型列表
			  	shipTypeList: [],
			  	// 载货类型
			  	loadCargoTypeList: [],
			  	// 航空公司列表
			  	airlineList: [],
			  	// 机型
			  	aircraftTypeList: [],
			  	// 省
			  	provinceList: [],
			  	// 市
			  	fromCityList: [],
			  	toCityList: [],
			  	// 出发地机场
			  	airFromAirportList: [],
			  	// 到达地机场
			  	airToAirportList: []
			}
		},
		props: ['type','lineType','detail',"isSee"],
		// props: {
		// 	type: {
		// 		default: 'add'
		// 	},
		// 	lineType: {
		// 		default: 1
		// 	},
		// 	detail: default: () => {}
		// },
		components: {
			// Footer
			MapSvg,
			Web,
			User
		},
		beforeCreate() {
			this.form = this.$form.createForm(this);
		},
		created() {

			this.disabled = this.isSee?true:false;
			// this.form.getFieldDecorator('lineType', { initialValue: [1], preserve: true });
			// this.getWagon();
			this.getCarType();
			this.getHighwayList();
			this.getRailway();
			this.getSeaway();
			this.getAirline();
			this.getAircraftTypeList();
			this.getShipType();
			this.getloadCargoType();
			this.getProvince();
			this.getWeightList()
			setTimeout(()=>{
				 console.log('type:::',this.type,this.detail)
				if (this.type != 'add'){
					let d = this.detail;
					if(d.fromProvince)this.getFromCity(d.fromProvince)
					if(d.toProvince)this.getToCity(d.toProvince)
					
					if(d.lineType == 4)this.seakey = d.transType
					let obj = {
						fromCity:d.beginPlace,
						toCity:d.endPlace,
//						fromCity: d.fromProvince+'-'+d.fromCity+'-'+d.fromCounty,
//						toCity: d.toProvince+'-'+d.toCity+'-'+d.toCounty,
//						fromAirPortTcode:d.fromAirPortTcode,
//						toAirPortTcode:d.toAirPortTcode,
						
						transType: d.transType,
						carType: d.carType,
						validDay: d.validDay,
						airTransfer: d.airTransfer,
						airCompany: d.airCompany,
						airModel: d.airModel,

						transDay: d.transDay,
						loadCargoType: d.loadCargoType,
						// longValid: d.longValid==1?true:false,
						fromLinkMan: d.fromLinkMan,
						fromLinkMobile: d.fromLinkMobile,
						fromLinkQq: d.fromLinkQq,
						fromLinkFax: d.fromLinkFax,
						fromLinkAddress: d.fromLinkAddress,
						toLinkMan: d.toLinkMan,
						toLinkMobile: d.toLinkMobile,
						toLinkQq: d.toLinkQq,
						toLinkFax: d.toLinkFax,
						toLinkAddress: d.toLinkAddress,
						fromTime: d.fromTime&&moment( d.fromTime, 'YYYY-MM-DD HH:mm:ss'),
						toTime: d.toTime&&moment( d.toTime, 'YYYY-MM-DD HH:mm:ss'),
						airSpaceTotal: d.airSpaceTotal,
						airSpaceSurplus: d.airSpaceSurplus,
						description: d.description,
						
					}
					this.inputs = d.validDay
					if(d.longValid==1){
						this.longValid = true
						this.longValidDisabled = false;
						this.validDayDisabled = true;
					}else{
						this.longValid = false
						this.longValidDisabled = true;
						this.validDayDisabled = false;
					}
					if (d.lineType == 1) {
						this.railbkey = d.transType;
					}
					if (d.lineType == 2){
						this.railwaykey = d.transType;
					}
					if (d.lineType == 3) {
						this.getfromPortInfo(d.fromAirPortTcode)
						this.getToPortInfo(d.toAirPortTcode)
					}
					// 航空运输运价特别处理
					// if (d.lineType == 3) {
					// 	let arr = d.airSeaPrice.split('|');
					// 	obj.airSeaPrice_1 = arr[0].split('-')[1];
					// 	obj.airSeaPrice_2 = arr[1].split('-')[1];
					// 	obj.airSeaPrice_3 = arr[2].split('-')[1];
					// 	obj.airSeaPrice_4 = arr[3].split('-')[1];
					// 	obj.airSeaPrice_5 = arr[4].split('-')[1];
					// 	obj.airSeaPrice_6 = arr[5].split('-')[1];
					// 	console.log(airSeaPrice_6)
					// 	this.form.getFieldDecorator('airSeaPrice_1', { initialValue: obj.airSeaPrice_1, preserve: true });
					// 	this.form.getFieldDecorator('airSeaPrice_2', { initialValue: obj.airSeaPrice_2, preserve: true });
					// 	this.form.getFieldDecorator('airSeaPrice_3', { initialValue: obj.airSeaPrice_3, preserve: true });
					// 	this.form.getFieldDecorator('airSeaPrice_4', { initialValue: obj.airSeaPrice_4, preserve: true });
					// 	this.form.getFieldDecorator('airSeaPrice_5', { initialValue: obj.airSeaPrice_5, preserve: true });
					// 	this.form.getFieldDecorator('airSeaPrice_6', { initialValue: obj.airSeaPrice_6, preserve: true });
					// }
					if(d.lineType == 4){
						this.seakey = d.transType;
					}
					if (d.lineType == 4 && d.transType==37 && d.airSeaPrice) {
						let arr = d.airSeaPrice.split('|');
						obj.airSeaPrice_1 = arr[0].split('-')[1];
						obj.airSeaPrice_2 = arr[1].split('-')[1];
						obj.airSeaPrice_3 = arr[2].split('-')[1];
						obj.airSeaPrice_4 = arr[3].split('-')[1];
						this.form.getFieldDecorator('airSeaPrice_1', { initialValue: obj.airSeaPrice_1, preserve: true });
						this.form.getFieldDecorator('airSeaPrice_2', { initialValue: obj.airSeaPrice_2, preserve: true });
						this.form.getFieldDecorator('airSeaPrice_3', { initialValue: obj.airSeaPrice_3, preserve: true });
						this.form.getFieldDecorator('airSeaPrice_4', { initialValue: obj.airSeaPrice_4, preserve: true });
						this.seakey = d.transType;
					}
					if (d.lineCycle) {
						let arr = d.lineCycle.split(',');
						if (arr.length){
							obj.week_1 = arr[0]==1?true:false;
							obj.week_2 = arr[1]==2?true:false;
							obj.week_3 = arr[2]==3?true:false;
							obj.week_4 = arr[3]==4?true:false;
							obj.week_5 = arr[4]==5?true:false;
							obj.week_6 = arr[5]==6?true:false;
							obj.week_7 = arr[6]==7?true:false;

							this.form.getFieldDecorator('week_1', { initialValue: obj.week_1, preserve: true });
							this.form.getFieldDecorator('week_2', { initialValue: obj.week_2, preserve: true });
							this.form.getFieldDecorator('week_3', { initialValue: obj.week_3, preserve: true });
							this.form.getFieldDecorator('week_4', { initialValue: obj.week_4, preserve: true });
							this.form.getFieldDecorator('week_5', { initialValue: obj.week_5, preserve: true });
							this.form.getFieldDecorator('week_6', { initialValue: obj.week_6, preserve: true });
							this.form.getFieldDecorator('week_7', { initialValue: obj.week_7, preserve: true });
						}
					}
					this.form.setFieldsValue(obj);
				}
			},100)
			setTimeout(()=>{
				if (this.type != 'add'){
					let d = this.detail;
					
					this.form.setFieldsValue({

						airFromProvince:d.fromProvince,
//						airFromCity:d.fromCity,
						airToProvince:d.toProvince,
//						airToCity:d.toCity,
						volumePrice:d.volumePrice,
						weightPrice:d.weightPrice,
						transPrice: d.transPrice,
						weightPriceUnit:d.weightPriceUnit,
						airNo: d.airNo,
					});
				}
			},1000)
		},
		watch: {
			'$route': function () {
				if(this.form) 
				this.form.resetFields()
				this.longValid = false
				this.longValidDisabled = false
				this.validDayDisabled = false
				this.inputs = ''
			},
		},
		methods: {
			// from 表单内容重置
			fromReset() {
				this.form.resetFields();
				this.longValid = false
				this.longValidDisabled = false
				this.validDayDisabled = false
				this.inputs = ''
			},
			// 校验手机号
			checkMobile:checkTel,
			close(){
				this.webShow=false;
				this.userShow=false;
			},
			// 根据机场获取信息
			getfromPortInfo(data){
				var val = {
					tcode:data
				}
				this.$get('/info/airPort',val).then((r) => {
					this.getFromAirport(r.data.data.rows[0].cityname)
					this.form.setFieldsValue({
						airFromCity:r.data.data.rows[0].cityname,
						fromAirPortTcode:data,
					});
	            }).catch((e) => {})
			},
			getToPortInfo(data){
				var val = {
					tcode:data
				}
				this.$get('/info/airPort',val).then((r) => {
					this.getToAirport(r.data.data.rows[0].cityname)
					this.form.setFieldsValue({
						airToCity:r.data.data.rows[0].cityname,
						toAirPortTcode:data,
					});
	            }).catch((e) => {})
			},
			// 获取国内省级区域
			getProvince(){
				this.$get('/info/airPort/provinces').then((r) => {
					this.provinceList = r.data.data
	            }).catch((e) => {})
			},
			// 获取市级区域
			getFromCity(value){
				this.getCity('fromCityList',value)
				this.form.setFieldsValue({
					airFromCity: '',
					fromAirPortTcode:''
				})
				this.getFromAirport()
			},
			getToCity(value){
				this.getCity('toCityList',value)
				this.form.setFieldsValue({
					airToCity: '',
					toAirPortTcode:''
				})
			},
			// 出发地城市切换
			getFromAirport (value) {
				this.getAirport('airFromAirportList',value)
				this.form.setFieldsValue({
					fromAirPortTcode: ''
				})
			},
			// 到达地城市切换
			getToAirport (value) {
				this.getAirport('airToAirportList',value)
				this.form.setFieldsValue({
					toAirPortTcode: ''
				})
			},
			getCity(name,value){
				var val ={province:value}
				this.$get('/info/airPort/citynames',val).then((r) => {
//					console.log(r)
					this[name] = r.data.data
	            }).catch((e) => {})
			},
			getAirport(name,value){
				var val ={cityname:value}
				this.$get('/info/airPort',val).then((r) => {
//					console.log(r)
					this[name] = r.data.data.rows
	            }).catch((e) => {})
			},
			// 字典表接口 
			getCommonDict (nameList,type) {
				this.$get('/info/commonDict', {
					dictType: type,
					PageSize: 99
				}).then((r) => {
					this[nameList] = r.data.data.rows
				}).catch((e) => {
				})
			},
			// 获取车辆类型
			getWeightList() {
				this.getCommonDict('weightList',36);
			},
			// 获取车辆类型
			getCarType() {
				this.getCommonDict('carTypeList',5);
			},
			// 获取车皮类型
			// getWagon() {
			// 	this.getCommonDict('wagonList',10);
			// },
			// 获取公路运输类型
			getHighwayList() {
				this.getCommonDict('highwayList',11);
			},
			// 获取铁路运输类型
			getRailway() {
				this.getCommonDict('railwayList',12);
			},
			// 获取海路运输类型
			getSeaway() {
				this.getCommonDict('seawayList',13);
			},
			// 获取海路船舶类型
			getShipType() {
				this.getCommonDict('shipTypeList',32);
			},
			// 获取载货类型
			getloadCargoType() {
				this.getCommonDict('loadCargoTypeList',33);
			},
			// 获取航空公司列表
			getAirline() {
				this.getCommonDict('airlineList',23);
			},
			// 机型
			getAircraftTypeList () {
				this.getCommonDict('aircraftTypeList',27);
			},
			// 导航切换
			tabNavChange(key){
				this.lineType = key;
			},
			// 公路切换
			railChange(key){
				this.railbkey = key;
			},
			// 铁路切换
			railwayChange(key){
				this.railwaykey = key;
			},
			// 航空切换
			// avationChange(key){
			// 	this.avakey = key;
			// },
			//海路内容切换
			seawayChange(keys){
				// console.log(keys);
				this.seakey = keys;
			},
			// 省市地图回调
			mapSvgCall(d) {
				if (d.name === 'departure') {
					this.form.setFieldsValue({
						fromCity: d.provCityArea
					});
					this.form.setFieldsValue({
						airFromProvince:d.province,
					});
					this.getFromCity(d.province)
				}
				if (d.name === 'destination') {
					this.form.setFieldsValue({
						toCity: d.provCityArea
					});
					this.form.setFieldsValue({
						airToProvince:d.province,
					});
					this.getToCity(d.province)
				}
			},
			// 选择出发地
			departureShowMap() {
				this.$refs.mapSvgDialog.mapSvgVisible('departure', 2, '', '', '');
			},
			// 选择到达地
			destinationShowMap() {
				this.$refs.mapSvgDialog.mapSvgVisible('destination', 2, '', '', '');
			},
			// 调用距离返回
			distanceCall(num) {
				// console.log(num)
			},
			//重货价列表添加
			addHeavyPrice(){
				this.heavyPrice.push({
						number:'',
						onlineOffer:'',
						agreementOffer:''
					})
			},
			// 删除重货架列表
			delHeavyPrice(index){
				this.heavyPrice.splice(index,1)
			},
			// 重置重货架列表
			resetHeavyPrice(){
				this.heavyPrice = [{
					number:'',
					onlineOffer:'',
					agreementOffer:''
				}]
			},
			// 轻货价列表添加
			addLightPrice(){
				this.lightPrice.push({
						number:'',
						onlineOffer:'',
						agreementOffer:''
					})
			},
			// 删除轻货架列表
			delLightPrice(index){
				this.lightPrice.splice(index,1)
			},
			// 重置轻货架列表
			resetLightPrice(){
				this.lightPrice = [{
					number:'',
					onlineOffer:'',
					agreementOffer:''
				}]
			},
			// 添加提交
			handleSubmit(e) {
				if(this.loading) return;
				e.preventDefault();
				this.form.validateFields((err, values) => {
					console.log("values:",values,err)
					if(!err) {
						console.log('Received values of form: ', values);
						this.loading = true
						values.longValid = (this.longValid?1:0);
						if(this.longValid){
							values.validDay = ''
						}
						values.lineType = this.lineType;
						// 航空运输运价特别处理
						// if (this.lineType == 3) {
						// 	values.airSeaPrice = 'MIN-'+values.airSeaPrice_1+'|+45-'+values.airSeaPrice_2+'|+100-'+values.airSeaPrice_3+'|+300-'+values.airSeaPrice_4+'|+500-'+values.airSeaPrice_5+'|+1000-'+values.airSeaPrice_6;
						// }
						if(!values.airSeaPrice_1)values.airSeaPrice_1 = 0
						if(!values.airSeaPrice_2)values.airSeaPrice_2 = 0
						if(!values.airSeaPrice_3)values.airSeaPrice_3 = 0
						if(!values.airSeaPrice_4)values.airSeaPrice_4 = 0
						if (this.lineType == 4 ) {
							values.airSeaPrice = '20‘-'+values.airSeaPrice_1+'|40‘-'+values.airSeaPrice_2+'|40HQ-'+values.airSeaPrice_3+'|45‘-'+values.airSeaPrice_4;
						}
						// 周一〜周日
						if (this.lineType == 3 || this.lineType == 4) {
							let arr = [
								values.week_1?1:'',
								values.week_2?2:'',
								values.week_3?3:'',
								values.week_4?4:'',
								values.week_5?5:'',
								values.week_6?6:'',
								values.week_7?7:''
							];
							values.lineCycle = String(arr);
						}
						// 添加内部类型名称
						
						values.carTypeName = this.findTypeListName(this.carTypeList,values.carType);
						// 航空运输 运输类型处理
						if (this.lineType == 3) {
							values.transType = values.airCompany;
							values.transTypeName = this.findTypeListName(this.airlineList,values.transType);
							if(values.fromTime)values.fromTime = values.fromTime.format('YYYY-MM-DD HH:mm:ss')
							if(values.toTime)values.toTime = values.toTime.format('YYYY-MM-DD HH:mm:ss')
						}else{
							values.transTypeName = this.findTypeListName(this.highwayList,values.transType);
						}
						console.log('values::',values)
						// 省内省外区分 1省内 0省外
						if(values.fromCity)values.innerProvince = (values.fromCity.split('-')[0] == values.toCity.split('-')[0]) ? 1 : 0; 
//						if(values.airToProvince)values.toCity = values.airToProvince+'-'+values.airToCity
//						if(values.airFromProvince)values.fromCity = values.airFromProvince+'-'+values.airFromCity
						if (this.type === 'add') this.addInfoLine(values)
						if (this.type === 'edit') this.editInfoLine(values)
					}
				});
			},
			findTypeListName (obj,key) {
				let name = ''
			    obj.find((item,index)=>{
			        if (item.dictKey == key) {
			        	name = item.dictValue;
			        }
			    })
			    return name;
			},
			// 添加线路信息
			addInfoLine(values){
				this.$post('/info/line', values,true).then((r) => {
					console.log(r,8989)
					if(r.status == 200){
						this.$message.success('添加成功!')
						this.form.resetFields();
						this.clause = false
						this.longValid = false
						this.longValidDisabled = false
						this.validDayDisabled = false
						this.inputs = ''
					}
					this.loading = false;
				}).catch((e) => {
					this.loading = false;
				})
			},
			// 修改线路信息
			editInfoLine(values){
				values.lineId = this.detail.lineId;
				values.approvalStatus = 106;
				this.$put('/info/line', values,true).then((r) => {
					console.log(r,8989)
					if(r.status == 200){
						this.$message.success('编辑成功!')
						this.form.resetFields();
						this.$emit('handleCancel');
					}
					this.loading = false;
				}).catch((e) => {
					this.loading = false;
				})
			},
			//切换有效期与长期有效
//			changeDate(rule, value, callback) {
//				if(!!value){
//					this.longValidDisabled=true;
//					callback()
//				}else{
//					this.longValidDisabled=false;
//					callback()
//				}
//				return;
//			},
			// 监听input复选框禁止点击
			inpDay(e){
				var val = ''
				val = this.inputs
				if(val){
					this.longValidDisabled=true;
				}else{
					this.longValidDisabled=false;
				}
			},
			// 监听复选框  input禁止输入
			show(e){
				this.longValid = e.target.checked
				if(e.target.checked){
						this.validDayDisabled=true;
						this.longValidDisabled = false
				}else{
						this.validDayDisabled=false;
						this.longValidDisabled = false
						setTimeout(()=>{
							this.form.setFieldsValue({
								validDay:'',
							});
						},0)
				}
				return;
			},
			changeClause(rule, value, callback){
				console.log(value)
				if(value){
					this.clause=true;
					callback();
				}else{
					this.clause=false;
					callback();
				}
			}
		}
	}
</script>

<style lang="less">
.circuit-publish-form {
	margin-left:40px;
	li{
		list-style:none;
	}

	//线路信息
	.public-road-title{
		font-size:16px;
		color:#333333;
		font-weight:500;
		margin-top: 30px;
   	    line-height: 16px;
	}
	i{
		font-style:normal;
		margin-left:10px;
		font-size:14px;
	}
	//线路表格
	.publish-road-info{
		padding-bottom:10px;
		 border-bottom:1px solid #E8E8E8;
		 .ant-row{
		 	.ant-form-item-label{
		 		label{
		 			 font-size:14px;
		 			 color:#333333;
		 		}
		 	}
		 	.inp-w280{
		 		.ant-form-item-control,input{
			 	// 	width:280px;
					// height:40px;
		 	   }
		 	}
		 }
		//输入框宽140
		.together-w140{
			.ant-form-item-control,input{
			 	width:140px;
			 	height:40px;
			  }
		}
		.road-w170{
			.ant-form-item-control{
	 		 	width:207px;
	 		 	height:40px;
	 		 	input{
	 		 		width:140px;
	 		 	}
	 		 	.ant-col-8{
			    	margin-left:10px;
			    }
			}
		}
		.road-300{
			.ant-form-item-control{
				width:300px;
				.ant-select{
				    width: 70px;
				    font-size: 14px;
				    margin-left: 10px;
				    span{
				    	i{
				    		font-size:9px;
				    		//color:#15837A;
				    		line-height:20px;
				    	}
				    }
				}
			}	
		  .ant-col-6{
		  		margin-left:18px;
		  }
		  .ant-col-7{
		  		margin-left:42px;
		  }
		  .ant-col-12{
				line-height:38px;
			}
		}
		//运价公共样式
		.air-place{
				.ant-row:before{
					left:36px;
				}
			}
			ul{
				margin:0;
				padding:0;
				overflow: hidden;
				li{
					width:70px;
					float:left;
					margin-right:30px;
					font-size:14px;
					text-align:center;
				}
			}
			.air-title{
               li{
               	  color:#333333;
               }
			}
			.air-conntent{
				li{
					width:70px;
					height:40px;
					line-height:40px;
					input{
						color:#FFA200;
						text-align:center;
					}
				}
			}
		//公路运输
		.road-change-box{
			.ant-col-6:nth-child(2){
				margin-left:228px;
			}
		}
		.road-transport-part{
			.road-l6{
				.ant-col-12{
				   .ant-form-item{
				   		margin-left:6px;
				   }
				}
			}
			.ant-col-9{
				.ant-col-6{
					margin-left:8px;
				}
			}
			.ant-col-8{
				margin-right:10px;
			}
		 }
		 //铁路运输
		 .railway-transport-part{
		 	.ant-col-8{
				.ant-row:before{
					left:40px;
				}
			}
			.ant-col-24{
				.ant-col-2{
					margin-left:18px;
				}
				.ant-col-12 {
					.ant-form-item-control{
						width:200px;
				    }
				}
				
			}
		 }
		 //航空运输
		 .air-transport-part{
		 	.ant-col-8{
				.ant-row:before{
					left:40px;
				}
			}
		 }
		 //海路运输
		 .sea-transport-part{
		 	//海运整箱
		 	.ant-col-8{
	 			.ant-form-item-control{
	 				width:300px;
	 			}
	 			.ant-row:before{
			 		left:40px;
			 	}
		   }
		   .ant-col-2{
		   		margin-left:20px;
		   }
		   //海运拼箱
		   .seawy-left{
		   		.ant-col-9{
		   			.ant-col-6{
		   				margin-left:10px;
		   			}
		   		}
		   }

		  .seawy-freight{
	    	.ant-col-8{
	    		.ant-col-14{
	    			.ant-form-item-control{
	    				width:140px;
	    			}
	    		}
	    		.ant-col-7:nth-child(1){
	    			margin-left:6px;
	    		}
	    		.ant-row:before{
	    			left:6px;
	    		}
	    	}
		    .sea-freightL{
				.ant-col-16 {
					.ant-form-item-control{
						width:300px;
					}
				}
			}	
		  }
		 
	 }
	}
	//联系方式
	.start-concat-box{
		margin-top:20px;
		width:640px;
		height:203px;
		border:1px solid #DDDDDD;
		.start-place{
			width:60px;
			height:203px;
			background:#15837A;
			float:left;
			font-size:14px;
			color:#FFFFFF;
			line-height:203px;
			text-align:center;
		}
		.start-form{
			float:left;
			width:550px;
			padding-top:24px;
			.star-w150{
				.ant-form-item-control,input{
					width:150px;
					height:40px;
			  }
			}
			.ant-col-6{
					margin-left:22px;
			}
		}
		.ant-col-19{
			width:448px;
		}
	}
	//到达地
	.arrive-concat-box{
		padding-bottom:30px;
		border:1px solid #E8E8E8;
	}
	.public-agree{
		clear:both;
		line-height:82px;
		margin-top:40px;
		border-top:1px solid #E8E8E8;
	}
	//立即发布
	.public-btn{
		width:281px;
		height:50px;
		margin-top:30px;
		button{
			width:281px;
			height:50px;
			font-size:18px;
			color:#FFFFFF;
		}
	}
}
.circuit-publish-form .wei_yunjia{
	position: absolute;
	right: -25%;
}

.ant-modal-body .circuit-publish-form .wei_yunjia_l{
	position: absolute;
	right: -43%;
}

.inp-w280 .wei_weight{
	width: 62%;
	margin-right: 3%;
}
.inp-w280 .wei_select{
	width: 35%;
}
.circuit-publish-form .wei_low{
	position: absolute;
	right: -30%;
}
.ant-modal-body .circuit-publish-form .wei_low{
	position: absolute;
	right: -36%;
}
.circuit-publish-form .wei_yuan{
		position: absolute;
		right: -11%;
}

.ant-modal-body .circuit-publish-form .wei_yuan{
		position: absolute;
		right: -13%;
}
.fl{
	float: left;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
input[type="number"]{
  -moz-appearance: textfield;
}
.wy-form-item-left{
	float: left;
	display: flex;
}
</style>